![]() |
WOLF core
WOLF: A Modular Estimation Framework for Robotics
|
Matrix of tracked features, by track and by snapshot (Captures or time stamps) This class implements the following data structure: More...
#include <core/processor/track_matrix.h>
Public Member Functions | |
| TrackMatrix () | |
| virtual | ~TrackMatrix () |
| void | newTrack (FeatureBasePtr _ftr) |
| void | add (const SizeStd &_track_id, const FeatureBasePtr &_ftr) |
| void | add (const FeatureBasePtr &_ftr_existing, const FeatureBasePtr &_ftr_new) |
| void | remove (FeatureBasePtr _ftr) |
| void | remove (const SizeStd &_track_id) |
| void | remove (CaptureBasePtr _cap) |
| SizeStd | numTracks () const |
| SizeStd | trackSize (const SizeStd &_track_id) const |
| TrackConst | track (const SizeStd &_track_id) const |
| Track | track (const SizeStd &_track_id) |
| SnapshotConst | snapshot (CaptureBaseConstPtr _capture) const |
| Snapshot | snapshot (CaptureBasePtr _capture) |
| vector< FeatureBaseConstPtr > | trackAsVector (const SizeStd &_track_id) const |
| vector< FeatureBasePtr > | trackAsVector (const SizeStd &_track_id) |
| FeatureBaseConstPtrList | snapshotAsList (CaptureBaseConstPtr _cap) const |
| FeatureBasePtrList | snapshotAsList (CaptureBasePtr _cap) |
| TrackMatchesConst | matches (CaptureBaseConstPtr _cap_1, CaptureBaseConstPtr _cap_2) const |
| TrackMatches | matches (CaptureBasePtr _cap_1, CaptureBasePtr _cap_2) |
| FeatureBaseConstPtr | firstFeature (const SizeStd &_track_id) const |
| FeatureBasePtr | firstFeature (const SizeStd &_track_id) |
| FeatureBaseConstPtr | lastFeature (const SizeStd &_track_id) const |
| FeatureBasePtr | lastFeature (const SizeStd &_track_id) |
| FeatureBaseConstPtr | feature (const SizeStd &_track_id, CaptureBaseConstPtr _cap) const |
| FeatureBasePtr | feature (const SizeStd &_track_id, CaptureBasePtr _cap) |
| CaptureBaseConstPtr | firstCapture (const SizeStd &_track_id) const |
| CaptureBasePtr | firstCapture (const SizeStd &_track_id) |
| CaptureBaseConstPtr | lastCapture (const SizeStd &_track_id) const |
| CaptureBasePtr | lastCapture (const SizeStd &_track_id) |
| list< SizeStd > | trackIds (CaptureBaseConstPtr _capture=nullptr) const |
| TrackConst | trackAtKeyframes (const SizeStd &_track_id) const |
| Track | trackAtKeyframes (const SizeStd &_track_id) |
| void | cleanSnapshots () |
Matrix of tracked features, by track and by snapshot (Captures or time stamps) This class implements the following data structure:
Snapshots at each capture Cx: C1 C2 C3 C4 C5 Tracks for each matched feature: f1 — f3 — f7 — f11 – f14 <– track 1, of corresponding features in different captures | | | | | | f4 — f8 — f12 – f15 <– track 2 | | | | | f5 — f9 — f13 <– track 3 | | | f2 — f6 — f10 <– track 4
Each 'f' is a feature pointer of the type FeatureBasePtr
This structure allows accessing all the history of matched features with two different accesses:
Track: track-wise: a track of features matches along a timely sequence of Captures, indexed by time stamp.
map<TimeStamp ts, FeatureBasePtr f>
Snapshot: capture-wise: a set of features tracked in a single Capture, indexed by track id:
map<SizeStd track_id, FeatureBasePtr f>
The class makes sure that both accesses are consistent each time some addition or removal of features is performed.
The storage is implemented as two maps of maps, so each addition and removal of single features is accomplished in logarithmic time:
Tracks are identified with the track ID in f->trackId() Snapshots are identified with the Capture pointer in f->getCapture()
these fields of FeatureBase are initialized each time a feature is added to the track matrix:
add(Cap, track_id, f) will set f.capture_ptr = C and f.track_id = track_id.
so e.g. given a feature f,
getTrack (f->trackId()) ; // returns all the track where feature f is. getSnapshot(f->getCapture()) ; // returns all the features in the same capture of f.
| wolf::TrackMatrix::TrackMatrix | ( | ) |
|
virtual |
| void wolf::TrackMatrix::add | ( | const FeatureBasePtr & | _ftr_existing, |
| const FeatureBasePtr & | _ftr_new | ||
| ) |
| void wolf::TrackMatrix::add | ( | const SizeStd & | _track_id, |
| const FeatureBasePtr & | _ftr | ||
| ) |
| void wolf::TrackMatrix::cleanSnapshots | ( | ) |
| FeatureBaseConstPtr wolf::TrackMatrix::feature | ( | const SizeStd & | _track_id, |
| CaptureBaseConstPtr | _cap | ||
| ) | const |
| FeatureBasePtr wolf::TrackMatrix::feature | ( | const SizeStd & | _track_id, |
| CaptureBasePtr | _cap | ||
| ) |
| CaptureBasePtr wolf::TrackMatrix::firstCapture | ( | const SizeStd & | _track_id | ) |
| CaptureBaseConstPtr wolf::TrackMatrix::firstCapture | ( | const SizeStd & | _track_id | ) | const |
| FeatureBasePtr wolf::TrackMatrix::firstFeature | ( | const SizeStd & | _track_id | ) |
| FeatureBaseConstPtr wolf::TrackMatrix::firstFeature | ( | const SizeStd & | _track_id | ) | const |
| CaptureBasePtr wolf::TrackMatrix::lastCapture | ( | const SizeStd & | _track_id | ) |
| CaptureBaseConstPtr wolf::TrackMatrix::lastCapture | ( | const SizeStd & | _track_id | ) | const |
| FeatureBasePtr wolf::TrackMatrix::lastFeature | ( | const SizeStd & | _track_id | ) |
| FeatureBaseConstPtr wolf::TrackMatrix::lastFeature | ( | const SizeStd & | _track_id | ) | const |
| TrackMatchesConst wolf::TrackMatrix::matches | ( | CaptureBaseConstPtr | _cap_1, |
| CaptureBaseConstPtr | _cap_2 | ||
| ) | const |
| TrackMatches wolf::TrackMatrix::matches | ( | CaptureBasePtr | _cap_1, |
| CaptureBasePtr | _cap_2 | ||
| ) |
| void wolf::TrackMatrix::newTrack | ( | FeatureBasePtr | _ftr | ) |
| SizeStd wolf::TrackMatrix::numTracks | ( | ) | const |
| void wolf::TrackMatrix::remove | ( | CaptureBasePtr | _cap | ) |
| void wolf::TrackMatrix::remove | ( | const SizeStd & | _track_id | ) |
| void wolf::TrackMatrix::remove | ( | FeatureBasePtr | _ftr | ) |
| SnapshotConst wolf::TrackMatrix::snapshot | ( | CaptureBaseConstPtr | _capture | ) | const |
| Snapshot wolf::TrackMatrix::snapshot | ( | CaptureBasePtr | _capture | ) |
| FeatureBaseConstPtrList wolf::TrackMatrix::snapshotAsList | ( | CaptureBaseConstPtr | _cap | ) | const |
| FeatureBasePtrList wolf::TrackMatrix::snapshotAsList | ( | CaptureBasePtr | _cap | ) |
| TrackConst wolf::TrackMatrix::track | ( | const SizeStd & | _track_id | ) | const |
| vector< FeatureBasePtr > wolf::TrackMatrix::trackAsVector | ( | const SizeStd & | _track_id | ) |
| vector< FeatureBaseConstPtr > wolf::TrackMatrix::trackAsVector | ( | const SizeStd & | _track_id | ) | const |
| TrackConst wolf::TrackMatrix::trackAtKeyframes | ( | const SizeStd & | _track_id | ) | const |
| list< SizeStd > wolf::TrackMatrix::trackIds | ( | CaptureBaseConstPtr | _capture = nullptr | ) | const |